package com.freewater.parking.infrastructure.db;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.time.LocalDate;

public interface DailyRevenueDao extends JpaRepository<DailyRevenueTable, LocalDate> {

    @Query("update DailyRevenueTable t set t.revenue = t.revenue + :increment where t.id = :day ")
    @Modifying
    void updateRevenue(LocalDate day, int increment);
}
